import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
// https://vitejs.dev/config/
const rollupOptions = {
  external: ["fsevents", "fs-extra", "@types/fs-extra", "vite", "vue-tsc", "module", "@rollup/pluginutils", "vite-plugin-dts"],
};
export default defineConfig({
  plugins: [
    dts({
      outputDir: "./dist/types",
      insertTypesEntry: false,
      copyDtsFiles: true,
    }),
  ],
  build: {
    rollupOptions,
    minify: "esbuild",
    sourcemap: false,
    cssCodeSplit: true,
    lib: {
      entry: "./src/index.ts",
      name: "index",
      fileName: (format) => `index.${format}.js`,
      formats: ["es", "cjs", "umd", "iife"],
    },
  },
});
